package org.idea.qiyu.live.framework.redis.starter.key;

import org.idea.qiyu.live.framework.redis.starter.key.common.RedisKeyBuilder;
import org.idea.qiyu.live.framework.redis.starter.key.common.RedisKeyLoadMatch;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: sfx
 * Date: 2023-11-04
 * Time: 20:36
 */
@Configuration
@Conditional(RedisKeyLoadMatch.class)
public class GiftProviderCacheKeyBuilder extends RedisKeyBuilder {
    private static final String GIFT_CONSUMER_CACHE_KEY = "gift_consumer";
    private static final String GIFT_PK_CACHE_KEY = "gift_pk";
    private static final String GIFT_SEQ_NUM_CACHE_KEY = "gift_seq_num";


    public String buildGiftConsumerCacheKey(String uuid) {
        return super.getPrefix() + GIFT_CONSUMER_CACHE_KEY + super.getSplitItem() + uuid;
    }

    public String buildGiftPkCacheKey(Integer roomId) {
        return super.getPrefix() + GIFT_PK_CACHE_KEY + super.getSplitItem() + roomId;
    }

    public String buildGiftSeqNumCacheKey(Integer roomId) {
        return super.getPrefix() + GIFT_SEQ_NUM_CACHE_KEY + super.getSplitItem() + roomId;
    }
}